import request from '@/utils/request'

// 查询医嘱orders列表 (分页)
export function selectPageOrders(query) {
  return request({
    url: '/business/orders/selectPage',
    method: 'get',
    params: query
  })
}

// 查询医嘱orders列表 (不分页)
export function listOrders(query) {
  return request({
    url: '/business/orders/list',
    method: 'get',
    params: query
  })
}

// 查询 执行状态中的药品医嘱（临时：状态临时执行；长期：状态校对）的患者信息
export function getExistExecuteDrugList(query) {
  return request({
    url: '/business/orders/getExistExecuteDrugList',
    method: 'get',
    params: query
  })
}

// 查询 医嘱打印数
export function getOrderListPrint(query) {
  return request({
    url: '/business/orders/getOrderListPrint',
    method: 'get',
    params: query
  })
}

// 查询 执行状态中的药品医嘱明细（临时：状态临时执行；长期：状态校对）
export function findOrdersBottleLabel(query) {
  return request({
    url: '/business/orders/findOrdersBottleLabel',
    method: 'get',
    params: query
  })
}

// 查询出院未做医嘱项目
export function dischargedNotDoneOrders(query) {
  return request({
    url: '/business/orders/dischargedNotDoneOrders',
    method: 'get',
    params: query
  })
}

// 查询医嘱orders详细
export function getOrders(id) {
  return request({
    url: '/business/orders/' + id,
    method: 'get'
  })
}

// 新增医嘱orders
export function addOrders(data) {
  return request({
    url: '/business/orders',
    method: 'post',
    data: data
  })
}

// 模板引用新增医嘱orders
export function templateSubmitOkByOrderTemp(data) {
  return request({
    url: '/business/orders/templateSubmitOkByOrderTemp',
    method: 'post',
    data: data
  })
}

// 医嘱瓶签打印
export function orderLabelPrint(data) {
  return request({
    url: '/business/orders/orderLabelPrint',
    method: 'post',
    data: data
  })
}

// 修改医嘱orders
export function updateOrders(data) {
  return request({
    url: '/business/orders',
    method: 'put',
    data: data
  })
}

// 删除医嘱orders
export function delOrders(id) {
  return request({
    url: '/business/orders/' + id,
    method: 'delete'
  })
}

// 修改医嘱orders 状态
export function updateOrderStatus(data) {
  return request({
    url: '/business/orders/updateOrderStatus',
    method: 'post',
    data: data
  })
}

// 根据医嘱获取需要摆药的药品信息
export function getPatientDispInfo(data) {
  return request({
    url: '/business/orders/getPatientDispInfo',
    method: 'post',
    data: data
  })
}

// 根据医嘱获取需要摆药的药品信息明细
export function getPatientDispInfoDetail(data) {
  return request({
    url: '/business/orders/getPatientDispInfoDetail',
    method: 'post',
    data: data
  })
}

// 摆药确认
export function drugDispQuantityDeduction(data) {
  return request({
    url: '/business/orders/drugDispQuantityDeduction',
    method: 'post',
    data: data
  })
}

// 查询病区所有医嘱状态分类的总数
export function selectOrderStatusInCount(query) {
  return request({
    url: '/business/orders/selectOrderStatusInCount',
    method: 'get',
    params: query
  })
}


// 获取医嘱摆药追溯码药品信息
export function getOrdersTraceabilityCodeList(data: any) {
  return request({
    url: "/business/orders/getOrdersTraceabilityCodeList",
    method: "post",
    data: data,
  });
}
